forked from TrueCloudLab/frostfs-node
[#11] Rename contract-related NeoFS
occurences
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
9cb4b4cc17
commit
054bc4a727
11 changed files with 34 additions and 34 deletions
|
@ -163,7 +163,7 @@ func (e *notHaltStateError) Error() string {
|
|||
|
||||
var errEmptyInvocationScript = errors.New("got empty invocation script from neo node")
|
||||
|
||||
// implementation of error interface for NeoFS-specific errors.
|
||||
// implementation of error interface for FrostFS-specific errors.
|
||||
type frostfsError struct {
|
||||
err error
|
||||
}
|
||||
|
@ -172,8 +172,8 @@ func (e frostfsError) Error() string {
|
|||
return fmt.Sprintf("frostfs error: %v", e.err)
|
||||
}
|
||||
|
||||
// wraps NeoFS-specific error into frostfsError. Arg must not be nil.
|
||||
func wrapNeoFSError(err error) error {
|
||||
// wraps FrostFS-specific error into frostfsError. Arg must not be nil.
|
||||
func wrapFrostFSError(err error) error {
|
||||
return frostfsError{err}
|
||||
}
|
||||
|
||||
|
@ -216,7 +216,7 @@ func (c *Client) TestInvoke(contract util.Uint160, method string, args ...interf
|
|||
}
|
||||
|
||||
if val.State != HaltState {
|
||||
return nil, wrapNeoFSError(¬HaltStateError{state: val.State, exception: val.FaultException})
|
||||
return nil, wrapFrostFSError(¬HaltStateError{state: val.State, exception: val.FaultException})
|
||||
}
|
||||
|
||||
return val.Stack, nil
|
||||
|
@ -433,7 +433,7 @@ func toStackParameter(value interface{}) (sc.Parameter, error) {
|
|||
result.Type = sc.BoolType
|
||||
result.Value = v
|
||||
default:
|
||||
return result, wrapNeoFSError(fmt.Errorf("chain/client: unsupported parameter %v", value))
|
||||
return result, wrapFrostFSError(fmt.Errorf("chain/client: unsupported parameter %v", value))
|
||||
}
|
||||
|
||||
return result, nil
|
||||
|
|
|
@ -26,8 +26,8 @@ const (
|
|||
NNSBalanceContractName = "balance.frostfs"
|
||||
// NNSContainerContractName is a name of the container contract in NNS.
|
||||
NNSContainerContractName = "container.frostfs"
|
||||
// NNSNeoFSIDContractName is a name of the frostfsid contract in NNS.
|
||||
NNSNeoFSIDContractName = "frostfsid.frostfs"
|
||||
// NNSFrostFSIDContractName is a name of the frostfsid contract in NNS.
|
||||
NNSFrostFSIDContractName = "frostfsid.frostfs"
|
||||
// NNSNetmapContractName is a name of the netmap contract in NNS.
|
||||
NNSNetmapContractName = "netmap.frostfs"
|
||||
// NNSProxyContractName is a name of the proxy contract in NNS.
|
||||
|
|
|
@ -243,12 +243,12 @@ func (c *Client) GetNotaryDeposit() (res int64, err error) {
|
|||
}
|
||||
|
||||
if len(items) != 1 {
|
||||
return 0, wrapNeoFSError(fmt.Errorf("%v: %w", notaryBalanceErrMsg, errUnexpectedItems))
|
||||
return 0, wrapFrostFSError(fmt.Errorf("%v: %w", notaryBalanceErrMsg, errUnexpectedItems))
|
||||
}
|
||||
|
||||
bigIntDeposit, err := items[0].TryInteger()
|
||||
if err != nil {
|
||||
return 0, wrapNeoFSError(fmt.Errorf("%v: %w", notaryBalanceErrMsg, err))
|
||||
return 0, wrapFrostFSError(fmt.Errorf("%v: %w", notaryBalanceErrMsg, err))
|
||||
}
|
||||
|
||||
return bigIntDeposit.Int64(), nil
|
||||
|
@ -475,12 +475,12 @@ func (c *Client) notaryInvoke(committee, invokedByAlpha bool, contract util.Uint
|
|||
|
||||
// check invocation state
|
||||
if test.State != HaltState {
|
||||
return wrapNeoFSError(¬HaltStateError{state: test.State, exception: test.FaultException})
|
||||
return wrapFrostFSError(¬HaltStateError{state: test.State, exception: test.FaultException})
|
||||
}
|
||||
|
||||
// if test invocation failed, then return error
|
||||
if len(test.Script) == 0 {
|
||||
return wrapNeoFSError(errEmptyInvocationScript)
|
||||
return wrapFrostFSError(errEmptyInvocationScript)
|
||||
}
|
||||
|
||||
// after test invocation we build main multisig transaction
|
||||
|
@ -570,7 +570,7 @@ func (c *Client) notaryCosigners(invokedByAlpha bool, ir []*keys.PublicKey, comm
|
|||
multisigScript, err := sc.CreateMultiSigRedeemScript(m, ir)
|
||||
if err != nil {
|
||||
// wrap error as NeoFS-specific since the call is not related to any client
|
||||
return nil, wrapNeoFSError(fmt.Errorf("can't create ir multisig redeem script: %w", err))
|
||||
return nil, wrapFrostFSError(fmt.Errorf("can't create ir multisig redeem script: %w", err))
|
||||
}
|
||||
|
||||
s = append(s, transaction.Signer{
|
||||
|
@ -704,7 +704,7 @@ func (c *Client) notaryMultisigAccount(ir []*keys.PublicKey, committee, invokedB
|
|||
err := multisigAccount.ConvertMultisig(m, ir)
|
||||
if err != nil {
|
||||
// wrap error as NeoFS-specific since the call is not related to any client
|
||||
return nil, wrapNeoFSError(fmt.Errorf("can't convert account to inner ring multisig wallet: %w", err))
|
||||
return nil, wrapFrostFSError(fmt.Errorf("can't convert account to inner ring multisig wallet: %w", err))
|
||||
}
|
||||
} else {
|
||||
// alphabet multisig redeem script is
|
||||
|
@ -713,7 +713,7 @@ func (c *Client) notaryMultisigAccount(ir []*keys.PublicKey, committee, invokedB
|
|||
multisigAccount, err = notary.FakeMultisigAccount(m, ir)
|
||||
if err != nil {
|
||||
// wrap error as NeoFS-specific since the call is not related to any client
|
||||
return nil, wrapNeoFSError(fmt.Errorf("can't make inner ring multisig wallet: %w", err))
|
||||
return nil, wrapFrostFSError(fmt.Errorf("can't make inner ring multisig wallet: %w", err))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ func StringFromStackItem(param stackitem.Item) (string, error) {
|
|||
func addFeeCheckerModifier(add int64) func(r *result.Invoke, t *transaction.Transaction) error {
|
||||
return func(r *result.Invoke, t *transaction.Transaction) error {
|
||||
if r.State != HaltState {
|
||||
return wrapNeoFSError(¬HaltStateError{state: r.State, exception: r.FaultException})
|
||||
return wrapFrostFSError(¬HaltStateError{state: r.State, exception: r.FaultException})
|
||||
}
|
||||
|
||||
t.SystemFee += add
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue