Skip to content

Commit

Permalink
Update contract invocation test
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Mar 20, 2023
1 parent a66d29a commit 5ed6c84
Showing 1 changed file with 13 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,8 @@ func (s *OperationsProcessorTestSuiteLedger) TestInvokeFunctionDetails() {
contractParamVal2 := xdr.Int32(-5)
contractParamVal3 := xdr.Uint32(6)
contractParamVal4 := xdr.Uint64(3)
scoObjectBytes := []byte{0, 1, 2}
contractParamVal5 := xdr.ScObject{
Type: xdr.ScObjectTypeScoBytes,
Bin: &scoObjectBytes,
}
contractParamVal5Addr := &contractParamVal5
contractParamVal6 := xdr.ScStaticScsTrue
contractParamVal5 := xdr.ScBytes([]byte{0, 1, 2})
contractParamVal6 := true

ledgerKeyAccount := xdr.LedgerKeyAccount{
AccountId: source.ToAccountId(),
Expand Down Expand Up @@ -143,16 +138,16 @@ func (s *OperationsProcessorTestSuiteLedger) TestInvokeFunctionDetails() {
U32: &contractParamVal3,
},
{
Type: xdr.ScValTypeScvBitset,
Bits: &contractParamVal4,
Type: xdr.ScValTypeScvU64,
U64: &contractParamVal4,
},
{
Type: xdr.ScValTypeScvObject,
Obj: &contractParamVal5Addr,
Type: xdr.ScValTypeScvBytes,
Bytes: &contractParamVal5,
},
{
Type: xdr.ScValTypeScvStatic,
Ic: &contractParamVal6,
Type: xdr.ScValTypeScvBool,
B: &contractParamVal6,
},
{
// invalid ScVal
Expand Down Expand Up @@ -186,9 +181,9 @@ func (s *OperationsProcessorTestSuiteLedger) TestInvokeFunctionDetails() {
s.assertInvokeHostFunctionParameter(serializedParams, 0, "Sym", args[0])
s.assertInvokeHostFunctionParameter(serializedParams, 1, "I32", args[1])
s.assertInvokeHostFunctionParameter(serializedParams, 2, "U32", args[2])
s.assertInvokeHostFunctionParameter(serializedParams, 3, "Bits", args[3])
s.assertInvokeHostFunctionParameter(serializedParams, 4, "Obj", args[4])
s.assertInvokeHostFunctionParameter(serializedParams, 5, "Ic", args[5])
s.assertInvokeHostFunctionParameter(serializedParams, 3, "U64", args[3])
s.assertInvokeHostFunctionParameter(serializedParams, 4, "Bytes", args[4])
s.assertInvokeHostFunctionParameter(serializedParams, 5, "B", args[5])
s.assertInvokeHostFunctionParameter(serializedParams, 6, "n/a", args[6])
})

Expand Down Expand Up @@ -225,8 +220,8 @@ func (s *OperationsProcessorTestSuiteLedger) TestInvokeFunctionDetails() {
Salt: salt,
},
},
Source: xdr.ScContractCode{
Type: xdr.ScContractCodeTypeSccontractCodeToken,
Source: xdr.ScContractExecutable{
Type: xdr.ScContractExecutableTypeSccontractExecutableToken,
},
},
},
Expand Down

0 comments on commit 5ed6c84

Please sign in to comment.