From d6275f1aefa8099981a32bfb8aef5ab621a5c746 Mon Sep 17 00:00:00 2001 From: Gkirito Date: Tue, 28 May 2024 22:36:08 +0800 Subject: [PATCH 1/2] build(mod): upgrade dependencies: go-bcs => v0.4.0 --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index e6c8401..984cda6 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/btcsuite/btcutil v1.0.2 github.com/coming-chat/go-aptos v0.0.0-20221013022715-39f91035c785 - github.com/fardream/go-bcs v0.2.1 + github.com/fardream/go-bcs v0.4.0 github.com/mitchellh/hashstructure/v2 v2.0.2 github.com/shopspring/decimal v1.3.1 github.com/stretchr/testify v1.8.0 diff --git a/go.sum b/go.sum index 7acaaa0..09d8996 100644 --- a/go.sum +++ b/go.sum @@ -17,6 +17,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fardream/go-bcs v0.2.1 h1:ffW/0Jr0b2WXLNPF8AX6wWI9ETVE4+aXkv2aIXVViwE= github.com/fardream/go-bcs v0.2.1/go.mod h1:UsoxhIoe2GsVexX0s5NDLIChxeb/JUbjw7IWzzgF3Xk= +github.com/fardream/go-bcs v0.4.0 h1:J2yQZRAnkg/yMgP9MPf/qj9jJfD6w/LCMdWtC9Cbn08= +github.com/fardream/go-bcs v0.4.0/go.mod h1:UsoxhIoe2GsVexX0s5NDLIChxeb/JUbjw7IWzzgF3Xk= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= From ca0ea13f504444d876acbb7efab0d5116c79238a Mon Sep 17 00:00:00 2001 From: Gkirito Date: Tue, 28 May 2024 22:36:51 +0800 Subject: [PATCH 2/2] test(sui_types): add bcs decode test --- sui_types/programmable_transaction_builder_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sui_types/programmable_transaction_builder_test.go b/sui_types/programmable_transaction_builder_test.go index bcc2d55..f2af29e 100644 --- a/sui_types/programmable_transaction_builder_test.go +++ b/sui_types/programmable_transaction_builder_test.go @@ -30,5 +30,10 @@ func TestTransferSui(t *testing.T) { ) txByte, err := bcs.Marshal(tx) require.NoError(t, err) + + var reTx = TransactionData{} + _, err = bcs.Unmarshal(txByte, &reTx) + require.NoError(t, err) + t.Logf("%x", txByte) }